﻿using System.Collections.Generic;
using Newtonsoft.Json;

namespace battlenet.wow.rt.sdk.data.dto
{
    public class AuctionFileInfo
    {
        [JsonProperty("realm")]
        public RealmInfo Realm { get; set; }

        [JsonProperty("auctions")]
        public List<AuctionItemInfo> Auctions { get; set; }
    }

    public class RealmInfo
    {
        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("slug")]
        public string Slug { get; set; }
    }

    public class AuctionItemInfo
    {
        [JsonProperty("auc")]
        public long AuctionId { get; set; }

        [JsonProperty("item")]
        public long ItemId { get; set; }

        [JsonProperty("owner")]
        public string Owner { get; set; }

        [JsonProperty("ownerRealm")]
        public string OwnerRealm { get; set; }

        [JsonProperty("bid")]
        public long Bid { get; set; }

        [JsonProperty("buyout")]
        public long Buyout { get; set; }

        [JsonProperty("quantity")]
        public int Quantity { get; set; }

        [JsonProperty("timeLeft")]
        public string TimeLeft { get; set; }

        [JsonProperty("rand")]
        public long Rand { get; set; }

        [JsonProperty("seed")]
        public long Seed { get; set; }

        [JsonProperty("context")]
        public long Context { get; set; }

        [JsonProperty("bonusLists")]
        public AuctionItemBonusInfo[] BonusLists { get; set; }

        [JsonProperty("modifiers")]
        public AuctionItemModifierInfo Modifiers { get; set; }

        // TODO: handle deserialization of derived items (e.g. PetItem which has extra properties)
    }

    public class AuctionItemBonusInfo
    {
        [JsonProperty("bonusListId")]
        public int BonusListId { get; set; }
    }

    public class AuctionItemModifierInfo
    {
        [JsonProperty("type")]
        public int Type { get; set; }

        [JsonProperty("value")]
        public int Value { get; set; }
    }
}
